import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { CDK_DRAG_CONFIG, DragDropModule } from '@angular/cdk/drag-drop';
import {
  CheckboxModule,
  DatatableModule,
  GroupModule,
  I18NModule,
  IconModule,
  OverflowModule,
  PopoverModule,
  RadioModule,
  SelectModule,
} from '@iux/live';
import { ColDisplayComponent, SelectionPipe } from './col-display.component';

const DragConfig = {
  dragStartThreshold: 0,
  pointerDirectionChangeThreshold: 5,
  zIndex: 10000,
};

@NgModule({
  declarations: [ColDisplayComponent, SelectionPipe],
  imports: [
    CommonModule,
    DatatableModule,
    DragDropModule,
    OverflowModule,
    SelectModule,
    FormsModule,
    ReactiveFormsModule,
    IconModule,
    PopoverModule,
    CheckboxModule,
    GroupModule,
    RadioModule,
    I18NModule,
  ],
  providers: [{ provide: CDK_DRAG_CONFIG, useValue: DragConfig }],
})
export class ColDisplayModule {}
